public class MyThread extends Thread{
    @Override
    public void run() {
        while (true){
            try{
                System.out.println("这是自定义线程");
                Thread.sleep(1000);
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        }
    }
}
